#include <iostream>
using namespace std;

#include <vector>
#include <string>
#include <algorithm>

class Solution
{
    struct cmp
    {
        bool operator()(const string& a, const string& b)
        {
            return a + b > b + a;
        }
    };
public:
    string largestNumber(vector<int>& nums)
    {
        vector<string> nums_str;

        for (auto& e : nums)
        {
            nums_str.push_back(to_string(e));
        }

        sort(nums_str.begin(), nums_str.end(), cmp());

        string ret;
        for (auto& e : nums_str)
            ret += e;

        return ret[0] == '0' ? "0" : ret;
    }
};


int main()
{
    vector<int> nums = { 10,2 };
    cout << Solution().largestNumber(nums);
    return 0;
}